﻿using System;
using System.Collections.Generic;
using BIS.Portal.Core.Base;
using BIS.Portal.Core.Global;

namespace BIS.Portal.Modules.CMS
{
    public partial class CmsListOtherArticleExcludeArticleDetailControl_Settings : ControlSettingBase
    {
        #region get data settings
        public string SLTinHienThi
        {
            get { return  GetControlSetting<string>(ModuleSettingNames.CmsListOtherArticleExcludeArticleDetail.txtSLTienHienThi,PortalContext.LanguageAlias); }
        }
        public bool HienThiAnh
        {
            get
            {
                return GetControlSetting<bool>(ModuleSettingNames.CmsListOtherArticleExcludeArticleDetail.ddlAnhMinhHoa, PortalContext.LanguageAlias);
            }

        }
        public bool HienTHiMota
        {
            get
            {
                return GetControlSetting<bool>(ModuleSettingNames.CmsListOtherArticleExcludeArticleDetail.ddlMoTa, PortalContext.LanguageAlias);
            }
 
        }
        public bool HienTHiLinkCT
        {
            get
            {
                return GetControlSetting<bool>(ModuleSettingNames.CmsListOtherArticleExcludeArticleDetail.ddlLinkCT, PortalContext.LanguageAlias);
            }
 
        }
        #endregion
        protected void Page_Load(object sender, EventArgs e)
        {
            loadData();
        }
        private  void  loadData()
        {
            if (SLTinHienThi != null) txtSLTienHienThi.Text = SLTinHienThi;
            ddlAnhMinhHoa.SelectedIndex = HienThiAnh ? 0 : 1;
            ddlMoTa.SelectedIndex = HienTHiMota ? 0 : 1;
            ddlLinkCT.SelectedIndex = HienTHiLinkCT ? 0 : 1;
        }

        public override void SaveSettings(Dictionary<string, string> settings)
        {
            SetControlSettingForAllLanguages(txtSLTienHienThi.ID, ModuleSettingNames.CmsListOtherArticleExcludeArticleDetail.txtSLTienHienThi, settings);
            SetControlSettingForAllLanguages(ddlAnhMinhHoa.ID, ModuleSettingNames.CmsListOtherArticleExcludeArticleDetail.ddlAnhMinhHoa, settings);
            SetControlSettingForAllLanguages(ddlMoTa.ID, ModuleSettingNames.CmsListOtherArticleExcludeArticleDetail.ddlMoTa, settings);
            SetControlSettingForAllLanguages(ddlLinkCT.ID, ModuleSettingNames.CmsListOtherArticleExcludeArticleDetail.ddlLinkCT, settings);
        }
    }
}